services:
  notifications-service-dev:
    container_name: 'boticord-notifications-dev'
    hostname: 'notifications-service'
    networks:
      - boticord-network-dev
    restart: unless-stopped
    depends_on:
      - postgres-dev
      - nats-dev
      - redis-dev
    environment:
      - BOTICORD_SERVICE=notifications-dev
    env_file:
      - .env-dev
    build:
      context: .
      dockerfile: Dockerfile
      target: notifications

  resources-service-dev:
    container_name: 'boticord-resources-dev'
    hostname: 'resources-service'
    networks:
      - boticord-network-dev
    restart: unless-stopped
    depends_on:
      - postgres-dev
      - nats-dev
      - redis-dev
    environment:
      - BOTICORD_SERVICE=resources-dev
    env_file:
      - .env-dev
    build:
      context: .
      dockerfile: Dockerfile
      target: resources

  search-service-dev:
    container_name: 'boticord-search-dev'
    hostname: 'search-service'
    networks:
      - boticord-network-dev
    restart: unless-stopped
    depends_on:
      - meili-dev
    environment:
      - BOTICORD_SERVICE=search-dev
    env_file:
      - .env-dev
    build:
      context: .
      dockerfile: Dockerfile
      target: search

  bot-service-dev:
    container_name: 'boticord-bot-dev'
    hostname: 'bot-service'
    networks:
      - boticord-network-dev
    restart: unless-stopped
    depends_on:
      - postgres-dev
      - nats-dev
      - redis-dev
    environment:
      - BOTICORD_SERVICE=bot-dev
    env_file:
      - .env-dev
    build:
      dockerfile: Dockerfile
      context: .
      target: bot

  cdn-service-dev:
    container_name: 'boticord-cdn-dev'
    hostname: 'cdn-service'
    networks:
      - boticord-network-dev
    restart: unless-stopped
    depends_on:
      - postgres-dev
      - nats-dev
      - redis-dev
    environment:
      - BOTICORD_SERVICE=cdn-dev
    env_file:
      - .env-dev
    build:
      dockerfile: Dockerfile
      context: .
      target: cdn

  users-service-dev:
    container_name: 'boticord-users-dev'
    hostname: 'users-service'
    networks:
      - boticord-network-dev
    restart: unless-stopped
    depends_on:
      - postgres-dev
      - nats-dev
      - redis-dev
    environment:
      - BOTICORD_SERVICE=users-dev
    env_file:
      - .env-dev
    build:
      dockerfile: Dockerfile
      context: .
      target: users

  nginx-dev:
    container_name: 'boticord-nginx-dev'
    hostname: 'nginx'
    networks:
      - boticord-network-dev
    restart: unless-stopped
    image: nginx
    volumes:
      - ./nginx.conf:/etc/nginx/templates/nginx.conf.template
    ports:
      - '127.0.0.1:81:80'
    environment:
      NGINX_ENVSUBST_OUTPUT_DIR: /etc/nginx
    env_file:
      - ./.env-dev

  nats-dev:
    container_name: 'boticord-nats-dev'
    hostname: 'nats'
    networks:
      - boticord-network-dev
    restart: unless-stopped
    image: nats

  meili-dev:
    container_name: 'boticord-meili-dev'
    hostname: 'meili'
    networks:
      - boticord-network-dev
    restart: unless-stopped
    image: 'getmeili/meilisearch:v1.1.1'
    volumes:
      - meili-dev:/meili_data
    env_file:
      - ./.env-dev

  adminer-dev:
    container_name: 'boticord-adminer-dev'
    hostname: 'adminer'
    networks:
      - boticord-network-dev
    restart: unless-stopped
    image: adminer

  redis-dev:
    container_name: 'boticord-redis-dev'
    hostname: 'redis'
    networks:
      - boticord-network-dev
    restart: unless-stopped
    image: redis
    command: --save 60 10
    volumes:
      - redis-dev:/data

  postgres-dev:
    container_name: 'boticord-postgres-dev'
    hostname: 'postgres'
    networks:
      - boticord-network-dev
    restart: unless-stopped
    image: postgres
    env_file:
      - ./.env-dev
    volumes:
      - postgres-dev:/var/lib/postgresql/data

volumes:
  postgres-dev:
  meili-dev:
  redis-dev:

networks:
  boticord-network-dev:
